<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStoreStationTable extends Migration
{
    /**
     * Run the migrations.
     * 店铺岗位
     * @return void
     */
    public function up()
    {
        Schema::create('store_station', function (Blueprint $table) {
            $table->increments('id');
	        $table->tinyInteger('station_id')->comment('岗位id');
	        $table->tinyInteger('store_id')->comment('店铺id')->nullable();
	        $table->string('name',20)->comment('岗位名称')->nullable();
	        $table->tinyInteger('num')->comment('配置人数')->nullable();
	        $table->tinyInteger('status')->comment('岗位有效状态:0短期有效，1永久有效,-1失效')->default(1);
	        $table->date('start_time')->comment('有效期开始时间')->nullable();
	        $table->date('end_time')->comment('有效期结束时间')->nullable();
	        $table->integer('department_id')->comment('部门id')->nullable();
	        $table->integer('company_id')->comment('所属公司id')->nullable();
	        $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('store_station');
    }
}
